
<app-progress-line *ngIf="isRequesting"></app-progress-line>
<app-error-message *ngIf="response && response.error">
  {{response.error.message}}
</app-error-message>
<div class="container-login">
  <div class="wrap-login" >
    <div class="success-message" *ngIf="response && response.data">
      <div class="login-header">
        <span>Request success</span>
        <p>
          Your request has been sent successfully to the <b>{{email}}</b>. You will recieve a password change link. If you did not recieve it within
          few minutes, checkyour spam or junk mailbox
        </p>
      </div>
    </div>
    <form *ngIf="!response || !response.data">
      <input type="text" class="app-reset-password-key" [value]="key">
      <div class="login-header">
        <span>Reset password</span>
        <p>Please enter your new password, and then confirm it again.</p>
      </div>
      <div class="form-group material-input">
        <input type="password" class="app-reset-password-pass1" material-input name="password1" [(ngModel)]="form.password1">
        <span class="focus-input" data-placeholder="Password"></span>
        <span class="error-message" *ngIf="error(response, 'password1')">{{error(response, 'password1')}}</span>
      </div>
      <div class="form-group material-input">
        <input type="password" class="app-reset-password-pass2" material-input name="password2" [(ngModel)]="form.password2">
        <span class="focus-input" data-placeholder="Repeat password"></span>
        <span class="error-message" *ngIf="error(response, 'password2')">{{error(response, 'password2')}}</span>
      </div>
      <div class="form-group login-button">
        <button type="submit" class="btn btn-primary" (click)="SubmitForm($event);">
          Update password
        </button>
      </div>
    </form>
    <div> Maybe you want to <a routerLink="/login">Login</a> Or <a routerLink="/signup">Signup</a>.</div>
  </div>
</div>